<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../jquery.min.js"></script>
</head>
<body>
    <div class="one">
        <div class="two">
            <div class="three">
                <div class="four">
                    我不容易
                </div>
            </div>
        </div>
    </div>
    <script>
        //可以用parents() 找到祖先元素 把里面写元素选择器就行了就可以返回指定的祖先元素
        console.log($('.four').parent().parent().parent());
        console.log($('.four').parents());
        console.log($('.four').parents('one'));

        // toFixed()保留几位小数
    </script>
</body>
</html>